<?php

$op = getOperate();
$modules = getModules();
$table = 'logs';
$_W['page']['title'] = '操作日志信息列表';
$username = $_GPC['username'];
$module = intval($_GPC['module']);
$operate =intval($_GPC['operate']);
$condition ="WHERE 1=1";
if (!empty($username)){
    $condition .= " AND username = '{$username}'";
}
if ($module!==0){
    $condition .=" AND module = {$module}";
    $_GET['module'] = $_GPC['module'];
}else{
    $condition .= "";
}
if ($operate!==0){
    $condition .=" AND operate ={$operate}";
}else{
    $condition .= "";
}

$pindex = max(1, intval($_GPC['page']));
$psize = 20; //ORDER BY createtime DESC
$list = pdo_fetchall("SELECT * FROM " . tablename($table) . $condition);
$total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename($table) . $condition);
$pager = pagination($total, $pindex, $psize);
template('sms/logs_list');
?>
